package com.woniu.service;

import com.woniu.entity.RbacPerm;
import com.woniu.entity.ResponseEntity;
import org.springframework.cache.annotation.Cacheable;

import java.util.Set;


/**
 * @author WenXin
 * @version 1.0
 * @description: TODO
 * @date 2022/9/3 12:51
 */
public interface RbacPermService {
    ResponseEntity findAll(int pageNum, int pageSize);

    int addOne(RbacPerm rbacPerm);

    int deleteById(int id);

    int update(RbacPerm rbacPerm);

    ResponseEntity searchByPerms(RbacPerm rbacPerm, int pageNum, int pageSize);

    //容器开启缓存后@EnableCaching,可以使用@Cacheable
    //将查询的结果存进redis中，key根据以下注解的命名方式来  value::key
    @Cacheable(value = "cachePerm", key = "#username")
    Set<String> findPermBySetRoles(String username);
}
